package com.jungle.bfi.domain.bo;

import com.jungle.base.criteria.Condition;
//import com.jungle.bfi.entity.ApiUrlPo;
import lombok.Data;
//import org.springframework.data.jpa.domain.Specification;

@Data
public class ApiUrlBo {
    private String id;
    /**
     * api地址(处理过的接口地址)
     */
    @Condition
    private String apiUrl;

    private String apiName;
    /**
     * 接口类型<br>
     * swagger-config:   https://192.168.10.1:9090/v3/api-docs/swagger-config<br>
     * swagger-api-docs: https://192.168.10.1:9090/auth/v3/api-docs
     */
    private String type;

//    public Specification<ApiUrlPo> extSpec() {
//        if (apiName == null) return null;
//        return (root, query, cb) -> cb.equal(root.get("apiName"), apiName);
//    }
//
//    public Specification<ApiUrlPo> extSpec(Specification<ApiUrlPo> spec) {
//        if (type == null) return spec;
//        Specification<ApiUrlPo> mySpec = (root, query, cb) -> cb.equal(root.get("type"), type);
//        return spec.and(mySpec);
//    }
}
